const mongoose = require("mongoose");

let diarybookSchema = mongoose.Schema({
    authorId: {
        type: String,
        required: true
    },
    otherAuthorId:[String],
    createAt: {
        type: Date,
        default: Date.now()
    },
    title: {
        type: String,
        required: true
    },
    coverPhoto:{ //封面图片地址
        type:String,
        default:'/static/cover/default.jpg'
    },
    overduetime: { // 过期时间
        type: Date,
        required:true
    },
    diaryItems: [String],
    description: String,
    private:{
        type:Boolean,
        default:false
    }
})

let diarybookModel = mongoose.model("diarybook", diarybookSchema);

module.exports = diarybookModel;